home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / vol15n10.zip / MULTIL.ZIP / MLSRC.ZIP / MSDEV / PROJECTS / MLAUNCH / MLAUNCH.H < prev    next >
C/C++ Source or Header  |  1996-03-01  |  2KB  |  70 lines

  1. // MultiLaunch Shell Extension
  2. // Shell Extension class and general class factory classes
  3. // (C)1996 Continuum Research
  4. // Written by Dr. John F. Lam
  5.  
  6. #include <objbase.h>
  7. #include <shlobj.h>
  8. #include "MLPage.h"
  9.  
  10. // Various initialization GUIDS that need to be defined
  11. // {3D61D3C2-7036-11CF-B097-0080C7440B7E}
  12.  
  13. DEFINE_GUID(CLSID_MultiLaunchPropSheet, 
  14. 0x3d61d3c2, 0x7036, 0x11cf, 0xb0, 0x97, 0x0, 0x80, 0xc7, 0x44, 0xb, 0x7e);
  15.  
  16. #define STRCLSID_MultiLaunchPropSheet "{3D61D3C2-7036-11CF-B097-0080C7440B7E}"
  17. #define STRPROGID_MultiLaunchPropSheet "MultiLaunch.1"
  18. #define STRDESCRIPTION_MultiLaunchPropSheet "Allow multiple programs to open a file extension type."
  19.  
  20. /////////////////////////////////////////////////////////////////////////////
  21. // Classes
  22.  
  23. class CClassFactory : public IClassFactory
  24. {
  25. protected:
  26.     ULONG m_cRef;
  27.     
  28. public:
  29.     CClassFactory ();
  30.     ~CClassFactory ();
  31.         
  32.     // IUnknown methods
  33.     STDMETHODIMP            QueryInterface (REFIID, LPVOID*);
  34.     STDMETHODIMP_(ULONG)    AddRef ();
  35.     STDMETHODIMP_(ULONG)    Release ();
  36.     
  37.     // IClassFactory methods
  38.     STDMETHODIMP CreateInstance (LPUNKNOWN, REFIID, LPVOID*);
  39.     STDMETHODIMP LockServer (BOOL);
  40. };
  41.  
  42. class CShellExtension : public IShellPropSheetExt, IShellExtInit, IContextMenu
  43. {
  44. protected:
  45.     ULONG   m_cRef;
  46.     char    m_szFile[MAX_PATH];
  47.     CMLPage MLPage;
  48.  
  49. public:
  50.     CShellExtension ();
  51.     ~CShellExtension ();
  52.     
  53.     // IUnknown methods
  54.     STDMETHODIMP            QueryInterface (REFIID, LPVOID*);
  55.     STDMETHODIMP_(ULONG)    AddRef ();
  56.     STDMETHODIMP_(ULONG)    Release ();
  57.     
  58.     // IShellPropSheetExt methods
  59.     STDMETHODIMP AddPages (LPFNADDPROPSHEETPAGE, LPARAM);
  60.     STDMETHODIMP ReplacePage (UINT, LPFNADDPROPSHEETPAGE, LPARAM);
  61.  
  62.     // IShellExtInit method
  63.     STDMETHODIMP Initialize (LPCITEMIDLIST, LPDATAOBJECT, HKEY);
  64.  
  65.     // IContextMenu methods
  66.     STDMETHODIMP QueryContextMenu (HMENU, UINT, UINT, UINT, UINT);
  67.     STDMETHODIMP InvokeCommand (LPCMINVOKECOMMANDINFO);
  68.     STDMETHODIMP GetCommandString (UINT, UINT, UINT*, LPSTR, UINT);
  69. };
  70.